{{ getHeaderHTML() | safe }}

<vk-title>{{ struct.name }} | NVK</vk-title>

<vk-centered>

  {{ getNavigationHTML() | safe }}

  <vk-struct>

    <vk-name>{{ struct.name }}</vk-name>

    <vk-description>{{ getObjectDescription(struct) | safe }}</vk-description>

    <vk-section-title>Syntax</vk-section-title>
    <vk-syntax>
      <pre><code class="language-js">{{ instantiationName | safe }} = {{ struct.name }}();
{{ instantiationName | safe }} = new {{ struct.name }}();
{{ instantiationName | safe }} = new {{ struct.name }}(object);</code></pre>
    </vk-syntax>

    <vk-section-title>Stub{%- if struct.returnedonly %} <vk-property-type type="read-only">read-only</vk-property-type>{%- endif -%}</vk-section-title>
    
    <vk-property-prototype id="expand-code" class="expand-btn"></vk-property-prototype>

    <vk-stub id="code-no-expand" style="display:none;">
      <pre><code class="language-js">let {{ instantiationName | safe }} = new {{ struct.name }}();
{% for member in members -%}
{{ getStructMemberStub(struct, member, false) | safe }}
{% endfor -%}
      </code></pre>
    </vk-stub>

    <vk-stub id="code-expanded" style="display:none;">
      <pre><code class="language-js">let {{ instantiationName | safe }} = new {{ struct.name }}();
{% for member in members -%}
{{ getStructMemberStub(struct, member, true) | safe }}
{% endfor -%}
      </code></pre>
    </vk-stub>

{%- if struct.returnedonly != true -%}
    <vk-section-title>Parameters</vk-section-title>

    <vk-properties>
      <vk-property-entry>
        <vk-property-prototype class="no-float">object</vk-property-prototype>
        <vk-property-description>When instantiated with an object, members can be filled directly.</vk-property-description>
      </vk-property-entry>
    </vk-properties>
{%- endif -%}
    <vk-section-title>Properties</vk-section-title>

    <vk-properties>
      {% for member in members -%}
      <vk-property-entry>
        <vk-property-prototype>{{ struct.name }}.prototype.<vk-prototype-name>{{ member.name }}</vk-prototype-name></vk-property-prototype>
        <vk-property-type type="{{ getCSSType(member) | safe }}">{{ getType(member) | safe }}</vk-property-type>
        <vk-property-description>{{ getObjectDescription(member) | safe }}</vk-property-description>
      </vk-property-entry>
      {% endfor %}
    </vk-properties>

    <vk-section-title>Default Properties</vk-section-title>

    <vk-properties>
      <vk-property-entry>
        <vk-property-prototype>{{ struct.name }}.prototype.<vk-prototype-name>memoryBuffer</vk-prototype-name></vk-property-prototype>
        <vk-property-type type="arraybuffer"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer">ArrayBuffer</a></vk-property-type>
        <vk-property-description>Native memory reference of the structure.</vk-property-description>
      </vk-property-entry>
      <vk-property-entry>
        <vk-property-prototype>{{ struct.name }}.<vk-prototype-name>memoryLayout</vk-prototype-name></vk-property-prototype>
        <vk-property-type type="object">Object</vk-property-type>
        <vk-property-description>Object describing the structure's memory layout.</vk-property-description>
      </vk-property-entry>
      <vk-property-entry>
        <vk-property-prototype>{{ struct.name }}.<vk-prototype-name>byteLength</vk-prototype-name></vk-property-prototype>
        <vk-property-type type="number">Number</vk-property-type>
        <vk-property-description>Total native byte length of the structure.</vk-property-description>
      </vk-property-entry>
    </vk-properties>

    <vk-section-title>Internal Properties</vk-section-title>

    <vk-description>These properties are mainly used by <i>nvk</i> internally.</vk-description>

    <vk-properties>
      <vk-property-entry>
        <vk-property-prototype>{{ struct.name }}.<vk-prototype-name>reset</vk-prototype-name></vk-property-prototype>
        <vk-property-description>Resets the native memory of the structure.</vk-property-description>
      </vk-property-entry>
      <vk-property-entry>
        <vk-property-prototype>{{ struct.name }}.<vk-prototype-name>flush</vk-prototype-name></vk-property-prototype>
        <vk-property-description>Writes the structure's data into the native memory.</vk-property-description>
      </vk-property-entry>
      <vk-property-entry>
        <vk-property-prototype>{{ struct.name }}.<vk-prototype-name>reflect</vk-prototype-name></vk-property-prototype>
        <vk-property-description>Synchronizes the structure's data with the native memory.</vk-property-description>
      </vk-property-entry>
    </vk-properties>

  </vk-struct>

</vk-centered>

<script>
const IS_ROOT = false;
</script>

<script type="text/javascript" src="../../assets/js/prism.min.js"></script>
<script type="text/javascript" src="../../assets/js/index.js"></script>
